//
//  idVertificationVC.swift
//  Demo_Pj1
//
//  Created by Zhu Jinxin on 2018/11/3.
//  Copyright © 2018 zcsmart. All rights reserved.
//

import UIKit

class idVertificationVC: UIViewController {
    
    override func viewWillAppear(_ animated: Bool) {
        super.viewWillAppear(animated)
        
        self.navigationController?.navigationBar.tintColor = UIColor.black
        
        
    }
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        
    }
    
    
    @IBAction func identityVertify(_ sender: UIButton) {
        
        let alertController = UIAlertController(title: "身份核实失败",
                                                message: "您的身份系统核实失败，造成该问题的可能原因：\n(1)您的身份尚未在学校登记。\n(2)您的身份信息在学校登记有误。\n请联系学校确认相关身份登记信息。", preferredStyle: .alert)
        let cancelAction = UIAlertAction(title: "好的", style: .cancel, handler: nil)
        alertController.addAction(cancelAction)
        
        changAligment(superView: alertController.view)
        
        self.present(alertController, animated: true, completion: nil)
        
        
    }
    
    func changAligment(superView:UIView){
        
        let subViews = superView.subviews
        for view in subViews{
            if view.isMember(of: UILabel.self) && (view as? UILabel)?.text != "身份核实失败" {
                (view as? UILabel)?.textAlignment = .left
                
            }else{
                changAligment(superView: view)
            }
        }
        
    }
    
}
